package com.daj.service;

import com.daj.dao.TeamDao;
import com.daj.pojo.Team;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ Since :  1.0
 * @ Author:  DAJ
 * @ Date  :  18:10 2021/6/29
 */
//配置了扫描包
@Service
public class TeamService {


    //xml配置了包扫描，这边直接注解创建对象
    @Autowired
    private TeamDao teamDao;

    //事务注解 Propagation.REQUIRED事务传播行为 ，rollbackFor = {Exception.class}异常信息
   // @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
    public int insert(Team team){
        int num = teamDao.insert(team);
        int num1= teamDao.insert(team);
        return num+num1;
    }
}
